package math;

/**
 * Created by thoughtworks on 25/7/14.
 */
public class MathOperations {
    public void fizzBuzz()
    {
        int i;
        for(i = 0;i < 100;i++)
        {
            if(i%3 == 0 || i%5 == 0)
            {
                if(i%3 == 0)
                {
                    System.out.print("fizz");
                }
                if(i%5 == 0)
                {
                    System.out.print("buzz");
                }
                System.out.print("\n");
            }
            else
            {
                System.out.println(i);
            }
        }
    }

    public void generatePrint(int n)
    {
        int i;
        for(i = 2; n != 1;i++)
        {
            while(n%i == 0)
            {
                System.out.print(i);
                n = n / i;
                if(n != 1) {
                    System.out.write(',');
                    System.out.write(' ');
                }
            }
        }
        System.out.println();
    }
}
